<?php

namespace app\api\controller\store;

use app\api\controller\BaseController;
use app\models\store\StoreCouponUser;
use app\Request;
use services\UtilService;
use utils\Json;

/**
 * 优惠券管理类
 * Class StoreCouponsController
 * @package app\api\controller\store
 */
class StoreCouponsController extends BaseController
{
    /**
     * 获取用户的优惠券的列表
     * @param Request $request
     * @return Json
     */
    public function lst(Request $request)
    {
        list($status, $page, $limit) = UtilService::getMore([
            ["status", ''],
            ["page", 0],
            ["limit", '']
        ], $request, true);
        return app("json")->successful(StoreCouponUser::getUserCouponList($request->uid(), $status, $page, $limit));
    }
}